<?php
	require_once '../lib/sql.utils.php';
	
	$authorId = $_POST['authorId'];
	$sql_util = new SqlUtils();
	$result = $sql_util -> getRows('SELECT * FROM authors WHERE authorId = '.$authorId);
?>
<div class="menu">
		Quản lý tác giả > Sửa tác giả
	</div>
<form id="myForm" name="myForm" method="post" enctype="multipart/form-data" action="service/process_edit_author.php">
	<input type="hidden" name="isImage" value="<?php echo $result[0]['authorImage']; ?>" />
	<input type="hidden" name="id" value="<?php echo $result[0]['authorId']; ?>" />
	<label for="name">Tên tác giả :</label>
	<input type="text" id="name" name="name" value="<?php echo $result[0]['authorName']; ?>" />
	<span id="check-name"></span>
	<br />
	<span>Hình ảnh đại diện : </span>
	<img width="80px" height="115px" src="<?php echo '../images/author/'.$result[0]['authorImage']; ?>" />
	<label for="upload">Thay thế :</label>
	<input type="file" name="upload" id="upload" />
	<span id="check-image"></span>
	<br />
	<label for="email">Email :</label>
	<input type="text" name="email" id="email" value="<?php echo $result[0]['authorEmail']; ?>" />
	<span id="check-email"></span>
	<br />
	<label for="description">Giới thiệu :</label>	
	<textarea id="description" name="description" rows="10" cols="70" >
		<?php echo $result[0]['authorDescription']; ?>
	</textarea>
	<span id="check-description"></span>
	<br />
	<input type="submit" id="button" name="button" value="Submit"/>
</form>